﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Drawing;
using System.Data;
using System.Text;
using System.Windows.Forms;
using DevExpress.XtraEditors;

namespace Fis.Win.Map
{
    public partial class InitializeMapControl : DevExpress.XtraEditors.XtraUserControl
    {
        public InitializeMapControl()
        {
            InitializeComponent();
        }

        private void lnkRate_Click(object sender, EventArgs e)
        {
            if (Fis.Win.Utils.AppSession.RightsValidata("BD.Rate", "View"))
                UIManager.ShowList<Forms.RateListForm>("RateListViewProvider");

        }

        private void lnkAccount_Click(object sender, EventArgs e)
        {
            if (Fis.Win.Utils.AppSession.RightsValidata("BD.ACCOUNT", "View"))
                UIManager.ShowList<Forms.AccountListForm>("AccountListViewProvider");

        }

        private void lnkAids_Click(object sender, EventArgs e)
        {
            if (Fis.Win.Utils.AppSession.RightsValidata("BD.AIDS", "View"))
                UIManager.ShowList<Forms.AidsListForm>("AidsListViewProvider");

        }

        private void lnkInit_Click(object sender, EventArgs e)
        {
            if (Fis.Win.Utils.AppSession.RightsValidata("INIT", "AddNew"))
            {
                if (Fis.Win.Utils.AppSession.IsComplateInitialize)
                {
                    XtraMessageBox.Show("已结束初始化");
                    return;
                }

                System.Collections.Hashtable m = new System.Collections.Hashtable();
                m["isInitialize"] = true;
                UIManager.ShowEdit<Forms.BillEditForm>("BillEditViewProvider", Agile.Engine.View.ViewState.AddNew, m);
            }

        }

        private void lnkCommit_Click(object sender, EventArgs e)
        {
            if (Fis.Win.Utils.AppSession.RightsValidata("INIT", "QUERY"))
            {
                if (Fis.Win.Utils.AppSession.IsComplateInitialize)
                {
                    XtraMessageBox.Show("已结束初始化");
                    return;
                }

                System.Collections.Hashtable model = new System.Collections.Hashtable();
                model["filter0"] = " AND FSTATUS=4";
                model["filter1"] = string.Empty;
                model["listtype"] = "init";

                UIManager.ShowList<Forms.BillListForm>("BillListViewProvider", model);
            }

        }

        private void lnkClose_Click(object sender, EventArgs e)
        {
            if (Fis.Win.Utils.AppSession.RightsValidata("INIT", "CLOSE"))
            {
                System.Collections.Hashtable model = new System.Collections.Hashtable();
                model["FormName"] = "结束初始化";
                UIManager.ShowList<Forms.AccountTreatForm>("AccountTreatViewProvider", model);
            }

        }
    }
}
